package com.imooc.spring.ioc;

import com.imooc.spring.ioc.service.User1Service;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.annotation.Resource;
import javax.annotation.Resources;

public class SpringApplication1 {

    @Resource
    User1Service user1Service;

    public void a() {
        user1Service.say();
    }

    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        User1Service user1Service = (User1Service) applicationContext.getBean("user1Service");
        user1Service.say();
//
//        SpringApplication1 springApplication1 = new SpringApplication1();
//        springApplication1.a();

    }
}
